import time
import os
from coin.support.feed_archive.app.rename_feed_tmp_file import rename_tmp_files

cmd = 'aws s3 sync /data/feed-data/`hostname` ' \
      's3://feed.raw.coin2.corp.prestolabs.io/data/flow/`hostname`/ ' \
      '--exclude="**/_*" --no-progress'

while True:
  rename_tmp_files()
  os.system(cmd)
  time.sleep(10 * 60)  # 10 mins
